<!--#include file="functions.asp" --> 
<%
	sql = "UPDATE EXIREG "
	sql = sql & "SET LOCATION = '" & request.querystring("id") & "' "
	sql = sql & "WHERE SEQNUM = " & request.querystring("seqnum")
	cn.execute(sql)
	
	sql = "SELECT * FROM EMP WHERE EMPCODE = '" & request.querystring("id") & "' "
	set rsEmp = cn.execute(sql)
	
	sql = "INSERT INTO EXIHIST (SEQNUM,TRANSTYPE,LOCATION,DEPARTMENT,DATE,UPDATEUSER,UPDATESTAMP) VALUES ("
	sql = sql & "'" & request.querystring("seqnum") & "',"
	sql = sql & "'IRT', "
	sql = sql & "'" & request.querystring("id") & "', "
	if not rsEmp.eof then
		sql = sql & "'" & rsEmp("DEPARTMENT") & "', " 
	else
		sql = sql & "NULL,"
	end if
	sql = sql & "GETDATE(), "
	sql = sql & "'" & UsrName & "', "
	sql = sql & "GETDATE())"
	cn.execute(sql)
%>

<script>
	top.opener.location = top.opener.location;
	window.close();
</script>